package cn.wolfcode.enums;

import lombok.Getter;

@Getter
public enum NoticeLevelEnum {
    PRESSING("紧急", 2),
    IMPORTANCE("重要", 1),
    ORDINARY("普通",0);

    private String name;
    private Integer value;

    NoticeLevelEnum(String name, Integer value){
        this.name = name;
        this.value = value;
    }

    public static String findName(Integer value){
        NoticeLevelEnum[] values = NoticeLevelEnum.values();
        for (NoticeLevelEnum anEnum : values) {
            if(anEnum.getValue().equals(value)){
                return anEnum.getName();
            }
        }
        return null;
    }
}
